home *** CD-ROM | disk | FTP | other *** search
/ 3D Games (Spidla) / 3dhry2.iso / Cube Drop 2001 1.0 / 3DFont.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2003-03-17  |  4.2 KB  |  156 lines

  1. /*
  2. Authors: David Nishimoto and Thomas Lee Young
  3. Website: http://www.listensoftware.com
  4. Program: Cube Drop
  5. */
  6.  
  7. #include "stdafx.h"
  8. #include "3DFont.h"
  9.  
  10. #include "MainFrm.h"
  11. #include "3DFontDoc.h"
  12. #include "3DFontView.h"
  13.  
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19.  
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CMy3DFontApp
  22.  
  23. BEGIN_MESSAGE_MAP(CMy3DFontApp, CWinApp)
  24.     //{{AFX_MSG_MAP(CMy3DFontApp)
  25.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  26.         // NOTE - the ClassWizard will add and remove mapping macros here.
  27.         //    DO NOT EDIT what you see in these blocks of generated code!
  28.     //}}AFX_MSG_MAP
  29.     // Standard file based document commands
  30.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  31.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  32.     // Standard print setup command
  33.     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  34. END_MESSAGE_MAP()
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CMy3DFontApp construction
  38.  
  39. CMy3DFontApp::CMy3DFontApp()
  40. {
  41.     // TODO: add construction code here,
  42.     // Place all significant initialization in InitInstance
  43. }
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // The one and only CMy3DFontApp object
  47.  
  48. CMy3DFontApp theApp;
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CMy3DFontApp initialization
  52.  
  53. BOOL CMy3DFontApp::InitInstance()
  54. {
  55.     AfxEnableControlContainer();
  56.  
  57.     // Standard initialization
  58.     // If you are not using these features and wish to reduce the size
  59.     //  of your final executable, you should remove from the following
  60.     //  the specific initialization routines you do not need.
  61.  
  62. #ifdef _AFXDLL
  63.     Enable3dControls();            // Call this when using MFC in a shared DLL
  64. #else
  65.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  66. #endif
  67.  
  68.     // Change the registry key under which our settings are stored.
  69.     // You should modify this string to be something appropriate
  70.     // such as the name of your company or organization.
  71.     SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  72.  
  73.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  74.  
  75.     // Register the application's document templates.  Document templates
  76.     //  serve as the connection between documents, frame windows and views.
  77.  
  78.     CSingleDocTemplate* pDocTemplate;
  79.     pDocTemplate = new CSingleDocTemplate(
  80.         IDR_MAINFRAME,
  81.         RUNTIME_CLASS(CMy3DFontDoc),
  82.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  83.         RUNTIME_CLASS(CMy3DFontView));
  84.     AddDocTemplate(pDocTemplate);
  85.  
  86.     // Parse command line for standard shell commands, DDE, file open
  87.     CCommandLineInfo cmdInfo;
  88.     ParseCommandLine(cmdInfo);
  89.  
  90.     // Dispatch commands specified on the command line
  91.     if (!ProcessShellCommand(cmdInfo))
  92.         return FALSE;
  93.  
  94.     // The one and only window has been initialized, so show and update it.
  95.     m_pMainWnd->ShowWindow(SW_SHOW);
  96.     m_pMainWnd->UpdateWindow();
  97.  
  98.     return TRUE;
  99. }
  100.  
  101. /////////////////////////////////////////////////////////////////////////////
  102. // CAboutDlg dialog used for App About
  103.  
  104. class CAboutDlg : public CDialog
  105. {
  106. public:
  107.     CAboutDlg();
  108.  
  109. // Dialog Data
  110.     //{{AFX_DATA(CAboutDlg)
  111.     enum { IDD = IDD_ABOUTBOX };
  112.     //}}AFX_DATA
  113.  
  114.     // ClassWizard generated virtual function overrides
  115.     //{{AFX_VIRTUAL(CAboutDlg)
  116.     protected:
  117.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  118.     //}}AFX_VIRTUAL
  119.  
  120. // Implementation
  121. protected:
  122.     //{{AFX_MSG(CAboutDlg)
  123.         // No message handlers
  124.     //}}AFX_MSG
  125.     DECLARE_MESSAGE_MAP()
  126. };
  127.  
  128. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  129. {
  130.     //{{AFX_DATA_INIT(CAboutDlg)
  131.     //}}AFX_DATA_INIT
  132. }
  133.  
  134. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  135. {
  136.     CDialog::DoDataExchange(pDX);
  137.     //{{AFX_DATA_MAP(CAboutDlg)
  138.     //}}AFX_DATA_MAP
  139. }
  140.  
  141. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  142.     //{{AFX_MSG_MAP(CAboutDlg)
  143.         // No message handlers
  144.     //}}AFX_MSG_MAP
  145. END_MESSAGE_MAP()
  146.  
  147. // App command to run the dialog
  148. void CMy3DFontApp::OnAppAbout()
  149. {
  150.     CAboutDlg aboutDlg;
  151.     aboutDlg.DoModal();
  152. }
  153.  
  154. /////////////////////////////////////////////////////////////////////////////
  155. // CMy3DFontApp commands
  156.